﻿@model MVCApp.Models.District

@{
    ViewBag.Title = @Model.Name;
}

<h2>@String.Format("{0} - {1}", Model.Name, Model.Number)</h2>

<div id="districtDetails">

    @if (Model.AssignedToUserId == WebSecurity.CurrentUserId || ViewBag.IsAdressSharingEnabled)
    {

        <div class="button">
            <a href="@Url.Action("Index", "DistrictAddresses", new { id = Model.Id })" class="withImage">
                <img src='~/Images/WindowsIcons/Light/appbar.people.profile.svg'/> @Strings.DistrictAddresses
            </a>
        </div>        

        <div class="button spacer">
            <a href="@Url.Action("Index", "SearchAddress", new { id = Model.Id })" class="withImage">
                <img src='~/Images/WindowsIcons/Light/appbar.magnify.browse.svg'/> @Strings.SearchAdresses
            </a>
        </div>
    }

    @if (Model.AssignedToUserId == WebSecurity.CurrentUserId)
    { 
        <h3 id="toggleReportCompletion">
            <span>@Strings.ReportDistrictCompletion </span><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
        </h3>

        @Html.Partial("~/Views/DistrictReport/_ReportCompletion.cshtml", Model)
    }
</div>

@Html.Partial("_Map")

<div class="spacer" />

@section scripts {

    <script type="text/javascript">

        $(document).ready(function () {
            $("#toggleReportCompletion").click(function () {
                $("#reportCompletion").toggle();
            });
        });

    </script>

}